﻿namespace nToDo
{
    using System;
    using System.Xml.Serialization;

    [Serializable]
    public class Task
    {
        [XmlIgnore]
        public string TaskId
        {
            get;
            set;
        }
        [XmlElement("DueDate")]
        public DateTime DueDate
        {
            get;
            set;
        }
        [XmlElement("Priority")]
        public int Priority
        {
            get;
            set;
        }

        public string PriorityText
        {
            get
            {
                return this.GetPriority(this.Priority);
            }
        }

        
        private string GetPriority(int PriorityId)
        {
            string result = string.Empty;
            switch (PriorityId)
            {
                case 0:
                    result = "High";
                    break;
                case 1:
                    result = "Normal";
                    break;
                case 2:
                    result= "Low";
                    break;
            }
            return result;
        }

        public string Notes
        {
            get;
            set;
        }

        public bool IsDone
        {
            get;
            set;
        }
    }
}
